<template>
  <div v-loading="isLoading">
    <queryPad @query="onQuery" @loading="onLoad" />
    <tablePad v-if="showTable" :tableData="tableData" />
  </div>
</template>

<script>
import queryPad from "./query.vue";
import tablePad from "./table.vue";
export default {
  name: "annualStatisic",
  data() {
    return {
      tableData: [],
      showTable: false,
      isLoading: false,
    };
  },
  components: { queryPad, tablePad },
  computed: {},
  methods: {
    onQuery(data) {
      this.isLoading = false;
      if (data && data.length > 0) {
        this.tableData = data;
        this.showTable = true;
      }
    },
    onLoad() {
      this.showTable = false;
      this.isLoading = true;
    },
  },
  mounted() {},
};
</script>
